/********************************Copyright (c)**********************************\
**
**                   (c) Copyright 2021, Main, China, QD.
**                           All Rights Reserved
**
**                                By(wo4fisher)
**                           http://www.wo4fisher.com
**
**----------------------------------文件信息------------------------------------
** 文件名称: bsp_leds.h
** 创建人员: wht
** 创建日期: 2021-06-09
** 文档描述:
**
**----------------------------------版本信息------------------------------------
** 版本代号: V0.1
** 版本说明: 初始版本
**
**------------------------------------------------------------------------------
\********************************End of Head************************************/

#ifndef __BSP_LEDS_H_
#define __BSP_LEDS_H_

#include "common.h"
#include "STC8Axx.h"
#include "zf_gpio.h"

#define  LED1_PIN  P0_0
#define  LED2_PIN  P0_1
#define  LED3_PIN  P0_2
#define  LED4_PIN  P7_4

#define LED1_ON  P00 = 0
#define LED2_ON  P01 = 0
#define LED3_ON  P02 = 0
#define LED4_ON  P74 = 0


#define LED1_OFF  P00 = 1
#define LED2_OFF  P01 = 1
#define LED3_OFF  P02 = 1
#define LED4_OFF  P74 = 1

#define LED1_TOGGLE P00 = !P00
#define LED2_TOGGLE P01 = !P01
#define LED3_TOGGLE P02 = !P02
#define LED4_TOGGLE P74 = !P74

typedef enum
{
	LED1 = 0, LED2, LED3, LED4,
} LEDS_enum;

void led_init();
void led_on(uint8 ledNum);
void led_off(uint8 ledNum);
void led_toggle(uint8 ledNum);
void led_flash_demo(uint8 a);


#endif

/********************************End of File************************************/